<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div {
            height: 150px;
            background: darkkhaki
        }
    </style>
</head>

<body>
    <!-- <div id="app" @click="divHandler">
        <!--  停止冒泡 事件到儿子为止，不会向父亲传播 -->
    <input type="button" value="按钮" @click.stop="buttonHandler">
    <!-- 阻止默认行为 -->
    <a href="https://cn.vuejs.org/v2/guide/events.html" @click.prevent>vue教程</a>
    </div> -->

    <div id="app" @click.self="divHandler">
        <!--  停止冒泡 事件到儿子为止，不会向父亲传播 -->
        <input type="button" value="按钮" @click="buttonHandler">
        <a href="https://cn.vuejs.org/v2/guide/events.html" @click.prevent.once>vue教程</a>
        <!-- 阻止默认行为 -->

    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data() {
                return {

                }
            },
            methods: {
                divHandler() {
                    console.log('div');
                },
                buttonHandler() {
                    console.log('button');
                }
            }
        })

    </script>
</body>

</html>